home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / data / powerbas / Docs / !Tutorials next >
Text File  |  1995-08-21  |  45KB  |  901 lines

  1. Tutorials for Powerbase
  2.  
  3. Powerbase is an extremely powerful program. Despite the fact that it is
  4. actually very easy to use its complexity and many features can make it
  5. difficult for the new user to get started. This booklet uses some ready made
  6. example databases supplied on the distribution disc to help familiarise you
  7. with the main functions of the program.
  8.  
  9. It is made up of two sections. The first is a Quick Tutorial aimed at
  10. inexperienced users who may not have used a database before. The Main
  11. Tutorial is meant for people who, although new to Powerbase, have some
  12. familiarity with other databases. If you do fall into this category you
  13. should skip the Quick Tutorial and move straight on to the Main Tutorial.
  14.  
  15.  
  16.  
  17. Quick Tutorial 
  18.  
  19. This tutorial is intended to acquaint the new user as painlessly as possible
  20. with the most commonly-used facilities of Powerbase. It does not explain how
  21. to create a database from scratch (see Chapter 4 − Creating a New Database −
  22. in the Manual), nor does it delve into the many advanced features, but it
  23. does explain how to:− 
  24.  
  25. (a)     Start up Powerbase and open an existing database.         
  26.  
  27. (b)     Browse through the database and search for individual records.        
  28.  
  29. (c)     Add new records and alter or delete existing ones.         
  30.  
  31. (d)     Query the database to create simple reports.         
  32.  
  33. (e)     Close the database. 
  34.  
  35. The supplied sample database Friends is used to illustrate most of these
  36. activities. If you have a hard disc you should copy Friends and Powerbase
  37. itself onto it before proceeding further. It is possible to use Powerbase
  38. from floppy discs only but some operations, such as printing lists, will be
  39. quite slow. Unless memory is very tight users of floppy discs are
  40. recommended to allocate at least 32K to the RAM disc and copy Friends onto
  41. it. Everything will then run much faster. Powerbase can provide
  42. context-sensitive help via Acorn’s !Help application and you are advised to
  43. load this, resizing the help window and placing it at the top right of the
  44. screen. Further help can be had by choosing the Help entry which will be
  45. found on Powerbase’s main menu and also on the icon-bar menu. 
  46.  
  47. 1  Starting Powerbase
  48.  
  49. Double-click on the Powerbase icon. After a few seconds it will appear on
  50. the icon-bar with the words “No data” beneath it to show that no database is
  51. open. Dragging the Friends icon onto the Powerbase icon on the icon-bar will
  52. open Friends for use and the words “No data” will be replaced by the name of
  53. the database. 
  54.  
  55. Two windows will open. One is the record window and displays the first
  56. record in the database, the one for Badgery Peter. The other is the keypad
  57. which allows you to control the browsing, searching and editing functions of
  58. Powerbase. The keypad is rather large and obscures quite a big area of the
  59. record window. The most-used buttons, however, are on the top two rows and
  60. the keypad can be moved part way off screen to get it out of the way. 
  61.  
  62. 2  Browsing and Searching
  63.  
  64. Now that you have a database running we will find out how to move from
  65. record to record and how to access any specific record by using a small
  66. group of letters called the key of the record.  All the mouse clicks
  67. referred to are made with the SELECT (left) button. If the chosen keypad
  68. action has an obvious opposite then you will find that using the ADJUST
  69. (right) mouse button brings about that effect.  e.g. While SELECT on the top
  70. left keypad button takes you to the start of the file, ADJUST on the same
  71. keypad button takes you to the end.
  72.  
  73. 2.1 Browsing through the Records
  74.  
  75. The top row of buttons on the keypad allows you to browse through the file.
  76. If you have !Help running, as previously suggested, it will tell you what
  77. each button does. Once you get the general idea you will find the symbols on
  78. the buttons logical and self-explanatory. The most commonly used ones act as
  79. follows:− 
  80.  
  81. (a)     The arrows at the ends of the row take you to the first and last
  82. records. You are at the first record now, so click with SELECT on the
  83. top-right button and you will see the record for Turnip Charles. The
  84. leftmost button takes you back to the start again. 
  85.  
  86. (b)     Movement through the file one record at a time is achieved using the
  87. single arrow keys next door to the ones you have just used. Try them out,
  88. noting the way records come up in alphabetical, or reverse alphabetical,
  89. order. 
  90.  
  91. (c)     The keys with double arrows let you make longer jumps through a
  92. file. The number of records skipped is shown in the writable icon between
  93. them and has a default value of 10. As there are only 10 records in Friends
  94. these keys will have the same effect as the “first” and “last” keys, unless
  95. you make the interval smaller. Click in the icon, delete the 10 and enter 5
  96. or 2, then try the double-arrow keys again. 
  97.  
  98. 2.2 Searching for a record
  99.  
  100. The fifth button on the second row of the keypad shows a question mark
  101. followed by a “record card” icon. We will call it the Search button. When
  102. clicked with SELECT a small window opens on the right-hand side of the
  103. keypad. This is the Search window and contains a writable icon in which to
  104. enter the key of the record you wish to display.  In this database keys are
  105. made up from the first 4 letters of the surname plus the initial so, if you
  106. wanted to call up the record for Bloggs Fred you would need to enter BLOGF.
  107. Do so then click on Find (or type the Return key on the keyboard) and the
  108. record will be displayed. Note that the key is shown in the window heading.   
  109.  
  110. If you enter the key of a non-existent record Powerbase displays the record
  111. which most nearly matches the key, but flashes the key field to warn you
  112. that what is being displayed is not what you asked for.
  113.  
  114. 3  Editing the Database
  115.  
  116. This part of the tutorial involves changes to the data. Make a working copy
  117. of the disc and put the original in a safe place. If you are using a copy of
  118. Friends on the RAM disc then the floppy disc won’t be altered, but it’s
  119. still not a good idea to work with the original disc. 
  120.  
  121. 3.1 Modifying records
  122.  
  123. Point the mouse at any field and click SELECT. The red text caret will
  124. appear in the field. The contents of the field may now be edited with the
  125. aid of the keystrokes which are standard for all RISC OS writable icons.
  126. i.e. 
  127.  
  128. Ctrl U  clears the field.       
  129.  
  130. Delete  removes the character to the left of the caret.        
  131.  
  132. Copy    removes the character to the right of the caret.        
  133.  
  134. Shift Copy      deletes the word to the right of the caret.        
  135.  
  136. Ctrl Copy       deletes everything from the caret to the end of the line.
  137.  
  138.  <=⇦ and => ⇨   move the caret left/right by one character.        
  139.  
  140. Shift <=⇦ and Shift=>⇨  move the caret left/right by one word.        
  141.  
  142. Ctrl <=⇦ and Ctrl =>⇨   move the caret to start and end of the field.           
  143.  
  144. Having modified one or more fields you may be wondering what you have to do
  145. to make Powerbase save the modified record so that the changes won’t be
  146. lost. You don’t need to do anything! Powerbase will ensure that your changes
  147. are saved when you display a different record or close the database. 
  148.  
  149. 3.2 Recovering data after a mistake
  150.  
  151. You may edit the wrong field by mistake and want to restore the previous
  152. contents. Call up Bloggs Fred’s record and change the address from “12
  153. Woodland Road  Exeter” to “12 Woodville Road  Exmouth”.  Now click MENU over
  154. the first line of the address. The second entry on the main menu (Field)
  155. contains a short group of letters called the tag of the field, in this case
  156. ADD1. Follow the right-pointing arrow to the Field sub-menu and choose the
  157. last entry; Undo changes. The contents of the field will revert to “12
  158. Woodland Road”. Notice that only the first line of the address is affected;
  159. the town is still “Exmouth”.  If you want to restore that field as well
  160. click MENU over it and follow the procedure just described.
  161.  
  162. There might be occasions when you make a hopeless mess of a record and want
  163. to discard all the changes and revert to what you started with.  You could,
  164. of course, “undo” each field separately as we just did for the street
  165. address and town but there’s a quicker way.  Look near the bottom of the
  166. main menu, (just above Help) and you will see that here too is an Undo
  167. changes option. Choosing this undoes all the alterations you have made.
  168.  
  169. It is important to realise that these facilities depend on the fact that
  170. Powerbase holds the currently-displayed record in memory and will therefore
  171. only work if the altered record has remained on display from the time you
  172. started changing it up to the point where you decided to “undo”. If you have
  173. looked at another record or clicked on Force update in the meantime then the
  174. changes will have been written to the disc and thus become “permanent”.
  175.  
  176. 3.3 Adding and deleting records
  177.  
  178. To add a new record we use the Add record button which looks like a plus
  179. sign and an index card. Clicking on this offers a blank record into which
  180. you can type new data. You don’t have to complete all the fields, in fact
  181. the only field into which you must type something is the NAME field. This is
  182. the key field; the one from which the key, mentioned earlier, is derived. If
  183. you leave the key field blank then nothing will be written to the database. 
  184.  
  185. Type the name “Bodmin George”, then go to the beginning of the file and step
  186. through it record by record. You will find that your new record has been
  187. inserted in the correct place, i.e. the sequence goes: Badgery, Bloggs,
  188. Bodmin, Cavendish. 
  189.  
  190. Now try deleting the record you’ve just added. There is a “dustbin” button
  191. which will do exactly that, but don’t use it just yet. Make sure that the
  192. unwanted record is on the screen and click the button to the right of the
  193. dustbin. You will now find that Bodmin’s record has vanished; the names now
  194. run straight from Bloggs to Cavendish, just as they did before you added
  195. Bodmin. 
  196.  
  197. This looks a bit too easy. Suppose you clicked the keypad button by mistake
  198. and deleted an important record?  No problem; what you have just done has
  199. been made easy because it’s far less drastic than it looks. The record
  200. hasn’t really been deleted at all. Click the button above the one you used
  201. for “deleting”. This shows a green right-pointing arrow and a card index
  202. icon. “Bodmin” will reappear. You will soon find, however, that it appears
  203. to be the only record in the file! Don’t worry; nothing has been lost. A
  204. Powerbase database is treated as six separate subfiles numbered 0−5. When
  205. you first open the database you are looking at Subfile 0 and the heading of
  206. the record window shows this. If you look at the heading now you will see
  207. that it has changed to Subfile 1. 
  208.  
  209. The buttons on either side of the bin carry pictures which suggest their
  210. true functions. They do not delete records; they merely move records from
  211. one subfile to another. The right button moves the displayed record to the
  212. next subfile in sequence. Thus, in the above case the “Bodmin” record has
  213. been moved from subfile 0 to subfile 1. A record in subfile 1 would be moved
  214. to subfile 2 and so on. When it gets to 5 the next click moves it into
  215. subfile 0 where it was originally. As you may have guessed, the left button
  216. moves records in the opposite direction, i.e. from subfile 1 to 0 or from
  217. subfile 0 to 5. 
  218.  
  219. If you do want to lose a record for good you consign it to the dustbin.  As
  220. this button’s action is more drastic than that of the other two you are
  221. given a chance to change your mind. A window  headed Powerbase: please
  222. confirm: will appear displaying the question Delete record permanently?
  223. Clicking OK causes the record to be deleted, Cancel removes the warning
  224. window from the screen leaving the record untouched.
  225.  
  226. 4  Printing Lists
  227.  
  228. Before Powerbase can produce a list it must be told:−
  229.  
  230. •       which fields should appear on the list 
  231.  
  232. •       which records should appear on the list
  233.  
  234. 4.1 Making the field selection
  235.  
  236. Specifying the fields you want is extremely easy. To include a field point
  237. at it and click with ADJUST. The selected field will then appear with its
  238. foreground and background colours reversed. If you change your mind you can
  239. de-select it by clicking on it again with ADJUST. The order in which you
  240. select the fields is the order in which they will appear in the printed
  241. list. Take care with this as there is nothing on the screen to indicate what
  242. order the fields will be in. Field selections may be saved (using Save
  243. selection from the Print submenu) and reloaded for future use. For now
  244. select the name and the first 3 fields of the address. 
  245.  
  246. 4.2 Choosing which records to print 
  247.  
  248. Specifying which records to print is somewhat more complicated, although
  249. efforts have been made to render it as simple as possible. With the mouse
  250. pointer in the record window click MENU. This displays the main Powerbase
  251. menu from which you should choose Print. A small window appears in which you
  252. can specify the criteria which must be met by records for inclusion in the
  253. list. If you just click over the Print button (or type Return) without
  254. entering anything, you will obtain a list of the whole database (or, more
  255. accurately, of the the whole of the current subfile). Try this first. 
  256.  
  257. When the search is complete the list will be displayed in a window. If you
  258. point to a record in the list and double-click with SELECT Powerbase will
  259. display the chosen record in the main record window. Note that the caret is
  260. placed in the field you were pointing to on the list. This is very useful if
  261. you spot errors in the data whilst examining a list. A double click on the
  262. offending item offers the record with the caret correctly positioned for
  263. editing. 
  264.  
  265. Most queries involve printing only some of the records, not the whole
  266. database. To target a particular group of records we need to enter a search
  267. formula which will distinguish the records we want to print from all the
  268. rest of the records. Search formulae can be quite complex and a more
  269. detailed treatment is given in the Manual. Only a few simple examples are
  270. shown here.  Enter the following and then click Print:− 
  271.  
  272. ADD2=Exeter 
  273.  
  274. The report window appears showing just one record: the one for “Bloggs
  275. Fred”. ADD2 is called the tag of the field. The label which appears beside a
  276. field on the screen is called its descriptor and you might have expected
  277. such labels to be used to refer to fields in search formulae. This is not
  278. done for two reasons:− 
  279.  
  280. (1)     Descriptors can be inconveniently long for use in this way.
  281.  
  282. (2)     Fields don’t necessarily have descriptors. Of the 5 address fields
  283. only the first has a descriptor (Address). Since every data field needs a
  284. “handle” of some sort so that we can include it in search formulae we give
  285. each a tag, which is never more than 4 characters. Clicking MENU over a
  286. field makes its tag appear in the second menu item. 
  287.  
  288. The record for “Bloggs Fred” is, however, not the only one with an address
  289. in Exeter. There is another (“Sunningdale Samantha”) but with Exeter in
  290. ADDR3 rather than ADDR2. You can print both on the same list by using the 
  291. formula:− 
  292.  
  293. ADD2,ADD3=Exeter 
  294.  
  295. Notice the way the alternative tags are separated by commas. We call this a
  296. tag list. A record will be printed if any one of the tags in the tag list is
  297. matched. The part of the search formula after the = sign is called the
  298. target and here too we may specify several in a target list. Try the
  299. following:− 
  300.  
  301. ADD3=Exeter,Anytown 
  302.  
  303. and also:−
  304.  
  305. ADD2,ADD3=Exeter,Anytown 
  306.  
  307. The first of these examples prints the records for “Soap Joe” and
  308. “Sunningdale Samantha”, the second prints these two and “Bloggs Fred” as
  309. well. What the second formula is saying is “Print all the records which have
  310. either ‘Exeter’ or ‘Anytown’ in either the ADD2 or ADD3 field”.
  311.  
  312. The characters we want to match don’t, of course, always make up the entire
  313. field. You can also search for part of a field. Suppose you wanted the
  314. records for people called Peter, Fred and Jean. Enter the formula:− 
  315.  
  316. NAME{Peter,Fred,Jean 
  317.  
  318. and you will find that the records for “Badgery Peter”, “Bloggs Fred” and
  319. “Ford Jean” are printed. The curly bracket (“{”) means “contains”. i.e. the
  320. name field doesn’t have to consist of Peter, or Fred or Jean, but has to
  321. contain one of these names somewhere within it. 
  322.  
  323. 4.3 Hard copy 
  324.  
  325. So far you have displayed reports in a window. If you want to send them to
  326. your printer run !Printers, switch on the printer, then click MENU over the
  327. displayed report. The Save as text option leads to a standard Save box from
  328. which you can drag the file icon to !Printers on the icon-bar. You could
  329. also drag it to a directory window to save it. Or you could simply type
  330. Return, in which case the report would be saved under a suitable default
  331. name in a directory called PrintJobs inside the Friends database directory.
  332. Every Powerbase database has a PrintJobs directory to use as a general
  333. dumping ground for reports and which needs to be cleared out periodically.
  334.  
  335. 5  Closing down
  336.  
  337. A database may be closed down by choosing the Close database entry from the
  338. icon-bar menu. When you do so all relevant data stored in memory is saved to
  339. disc and the database is closed. You do not have to do anything to save the
  340. database file itself to disc since it has been there all along. Only the
  341. current record is in memory at any one time and this is automatically
  342. written back to disc when it has been changed in any way.
  343.  
  344. There’s also an Abandon database entry on the icon-bar menu. This too will
  345. close your database but without saving new data to the disc. It is really
  346. intended as the quickest way to close a database which you have opened
  347. simply for examination. If you are entering data for real you should use
  348. Close database.
  349.  
  350. If you are going to use another database straight away just double click on
  351. it or drag it to the Powerbase icon on the icon bar. In fact you don’t even
  352. need to close the previous database before doing this; Powerbase will do it
  353. for you. 
  354.  
  355. When working with a database on the RAM disc Powerbase will issue a warning
  356. that the data is not secure and that you need to drag it from the RAM disc
  357. to a floppy or hard disc before switching off. 
  358.  
  359. To terminate Powerbase itself use the Quit option on the icon bar menu.
  360.  
  361.  
  362.  
  363. Main Tutorial
  364.  
  365. This section is intended to acquaint a new user with the most commonly-used
  366. facilities of Powerbase. It does not explain how to create a database from
  367. scratch but it does explain how to:−
  368.  
  369. (a)     Start up Powerbase and open an existing database.         
  370.  
  371. (b)     Browse through the database and search for individual records.         
  372.  
  373. (d)     Add new records and alter or delete existing ones.         
  374.  
  375. (d)     Query the database to create simple reports.         
  376.  
  377. (e)     Close the database. 
  378.  
  379. The sample database Elements is used to illustrate these activities. If you
  380. have a hard disc copy Elements and Powerbase itself onto it before
  381. proceeding further. It is possible to use Powerbase with floppy discs but
  382. some operations, such as printing lists, will be slow. Unless memory is very
  383. tight users of floppy discs are recommended to allocate at least 112K to the
  384. RAM disc and copy Elements onto it, which will make it much faster.
  385. Powerbase can provide context-sensitive help via Acorn’s !Help application
  386. and you are advised to load this, resizing the help window and placing it at
  387. the top right of the screen. Further help can be had by choosing the Help
  388. entry on Powerbase’s main menu or on the icon-bar menu. 
  389.  
  390. 1  Starting Powerbase
  391.  
  392. Double-click on the Powerbase icon. After a few seconds it will appear on
  393. the icon-bar with the words “No data” beneath it to show that no database is
  394. open. Dragging the ‘Elements’ icon onto the Powerbase icon on the icon-bar
  395. will open Elements for use and the words “No data” will be replaced by the
  396. name of the database. Double-clicking on the Elements icon has the same
  397. effect, in fact if Powerbase isn’t already on the icon-bar a double-click on
  398. Elements will install it for you provided that the Powerbase icon has been
  399. seen by the filer.
  400.  
  401. Two windows will open. One is the record window and displays the first
  402. record in the database. The other is the keypad which allows you to control
  403. the browsing, searching and editing functions of Powerbase. The keypad is
  404. rather large and obscures quite a big area of the record window. The
  405. most-used buttons, however, are on the top two rows and the keypad can be
  406. moved part way off screen to get it out of the way. 
  407.  
  408. 2  Browsing and searching
  409.  
  410. Now that you have a database running we will find out how to move from
  411. record to record and how to access any particular record by using a small
  412. group of letters called the key of the record.  All the mouse clicks
  413. referred to are made with the SELECT (left) button. If the chosen keypad
  414. action has an obvious opposite then you will find that using the ADJUST
  415. (right) mouse button brings about that effect.  e.g. While SELECT on the top
  416. left keypad button takes you to the start of the file, ADJUST on the same
  417. keypad button takes you to the end.
  418.  
  419. 2.1 Browsing through the records
  420.  
  421. The top row of buttons on the keypad allows you to browse through the file.
  422. If you have !Help running, as previously suggested, it will tell you what
  423. each button does. Once you get the general idea you will find the symbols on
  424. the buttons logical and self-explanatory. The most commonly used ones act as
  425. follows:− 
  426.  
  427. (1)     The buttons at the far left and right take you to the beginning and
  428. end of the file. The rightmost button takes you to ZIRCONIUM and the
  429. leftmost one to ACTINIUM. 
  430.  
  431. (2)     Single arrows move by one record at a time. From ACTINIUM, clicking
  432. the right arrow takes you to ALUMINIUM. The left arrow takes you back to
  433. ACTINIUM. 
  434.  
  435. (3)     Double arrows move through the file by longer jumps The right double
  436. arrow takes you from ACTINIUM to BISMUTH and the left one back to ACTINIUM.
  437. The “fast forward/rewind” value is shown in the box between these “fast
  438. wind” buttons. It is initially set to 10 but can be altered by clicking in
  439. it with SELECT and entering a new value. 
  440.  
  441. At either end of the file “wrap around” occurs. If you are at the last
  442. record (ZIRCONIUM) one record forward takes you to ACTINIUM again.
  443. Similarly, one record back from ACTINIUM goes to ZIRCONIUM. 
  444.  
  445. The second row has buttons marked like the “play” and “stop” controls of a
  446. cassette player. Play allows an automatic flip-through of the records
  447. without the need to touch any other buttons. When you get to the place you
  448. want, click on Stop. If the records go past too quickly you can slow the
  449. process down by increasing the number in the central icon of the top row of
  450. buttons. (This is normally used to set the “fast-wind” interval; see above.) 
  451.  
  452. 2.2 Key fields, Keys and Indices
  453.  
  454. When using the six buttons on the top row of the keypad you will have
  455. noticed that the records appear to be arranged alphabetically by the name of
  456. the element. The actual order in which records occur in the file is in fact
  457. nothing like alphabetical, but the order in which they are accessed is
  458. determined by an index which forces them to appear in alphabetical order.
  459. Every database must have at least one index, but you can have as many extra
  460. ones as you wish (subject to memory and disc limitations).                            
  461.  
  462. The second row of the keypad has two buttons featuring a blue arrow with a
  463. key symbol. Click on the right one and the record for HYDROGEN is displayed!
  464. If you now experiment with the top row of buttons as before you will find
  465. that the records no longer appear in alphabetical order of name but in order
  466. of ATOMIC NUMBER instead. What we have done is change to a different index.
  467. If a database has several indices the “key” buttons allow you to cycle
  468. through them in opposite directions. (Since Elements has only two indices
  469. the two buttons have exactly the same effect.) When you change to a
  470. different index the screen always displays the first record as determined by
  471. that index. 
  472.  
  473. An index is built from keys which are derived from a particular key field.
  474. The two indices used by Elements are based on the NAME and ATOMIC NUMBER
  475. fields. The way in which the key stored in the index is derived from the key
  476. field differs in the two cases. For the NAME index the first four letters of
  477. the name are used. Since no two elements have names beginning with the same
  478. four letters this gives a unique value for the key. (Two letters would not
  479. be enough because of names like CHLORINE and CHROMIUM.) The ATOMIC NUMBER
  480. index is based on the whole 3-digit maximum length and the ordering is
  481. numeric. Whenever a record is displayed the key is shown in the window title
  482. (# characters are for padding and should be ignored.) 
  483.  
  484. The record screen shows which fields are key fields and which are not. The
  485. labels, or descriptors, of fields are normally black. Where the fields are
  486. key fields they are shown in dark blue instead and the field used by the
  487. current index has its descriptor in red. Note also that the background
  488. colour of the NAME field is pale yellow whereas the rest are white . This
  489. indicates that NAME is the primary key field. The primary key is more
  490. important than the others. The index based on it is the only one which a
  491. database must have and is the one selected when a database is first opened. 
  492.  
  493. 2.3 Searching for a record
  494.  
  495. The fifth button on the second row of the keypad shows a question mark
  496. followed by a “record card” icon  We will call it the Search button. When
  497. clicked with SELECT a small window, the Search window, opens to the right of
  498. the keypad. It contains a writable icon in which to enter the key of the
  499. record you wish to display. Suppose you want to see the record for the
  500. element NITROGEN. If the current index is the NAME then enter NITR and
  501. either type the Return key on the keyboard or click the Find button with
  502. SELECT. The required record quickly appears. If you enter the key of a
  503. non-existent record Powerbase displays the record which most nearly matches
  504. the key, but flashes the key field to warn you that what is being displayed
  505. is not what you asked for. You don’t necessarily need to type the whole key;
  506. NIT would do in this case, but NI would be ambiguous (there are elements
  507. called NICKEL and NIOBIUM). 
  508.  
  509. To find NITROGEN when the ATOMIC NUMBER index is active you would need to
  510. know that the atomic number of nitrogen is 7. Change key, enter this number
  511. and type Return or click on Find. The required record appears. Abbreviated
  512. keys are not allowed in this case for obvious reasons; if you want element
  513. 103 (LAWRENCIUM) it’s no good entering 10 (NEON)!
  514.  
  515. You might want to examine a group of related records, e.g. the six similar
  516. elements LITHIUM, SODIUM, POTASSIUM, RUBIDIUM, CAESIUM and FRANCIUM which
  517. are known as the Alkali Metals. You could, of course, look up each in turn
  518. by entering its key but there is a better way. Click on the Use filter
  519. button on the keypad. The button becomes ticked and the Filter window opens
  520. on the right of the keypad. This button is what we call an option switch and
  521. is used to turn a particular feature ON or OFF. The six elements referred to
  522. all occur in group 1 of the Periodic Table of the elements so type GP=1 into
  523. the writable icon. and click on Filter.  The record for CAESIUM is
  524. displayed.  If you experiment with the buttons on the top row of the keypad
  525. you will find that they behave as if the six Alkali Metals were the only
  526. elements in the database; all the rest have been “filtered out” so that you
  527. access only the ones you are interested in.  To return to normal operation
  528. either click the Cancel button on the Filter window or turn off the switch
  529. on the keypad. 
  530.  
  531. 3  Editing the Database
  532.  
  533. This part of the tutorial involves changes to the data records. Make a
  534. working copy of the disc and put the original in a safe place. If you are
  535. using a copy of Elements on the RAM disc the floppy disc won’t be altered,
  536. but it’s not a good idea to work with the original disc. 
  537.  
  538. 3.1 Modifying records
  539.  
  540. Pointing the mouse at any field and clicking SELECT places the caret in that
  541. field. The contents of the field may then be edited in the standard way for
  542. RISC OS writable icons. i.e. 
  543.  
  544. Ctrl U  clears the field.       
  545.  
  546. Delete  removes the character to the left of the caret.        
  547.  
  548. Copy    removes the character to the right of the caret.        
  549.  
  550. Shift Copy      deletes the word to the right of the caret.        
  551.  
  552. Ctrl Copy       deletes everything from the caret to the end of the line.
  553.  
  554.  <=⇦ and => ⇨   move the caret left/right by one character.        
  555.  
  556. Shift <=⇦ and Shift=>⇨  move the caret left/right by one word.        
  557.  
  558. Ctrl <=⇦ and Ctrl =>⇨   move the caret to start and end of the field.            
  559.  
  560. Changes made to a record cause the record to be written back to the database
  561. whenever you display a different record or close the database. There is a
  562. button on the keypad called Force update but you don’t normally need to use
  563. it. 
  564.  
  565. 3.2 Using the scratchpad
  566.  
  567. It is sometimes necessary to copy the contents of one field into another,
  568. either in the same record or a different record. This can be done with the
  569. aid of the scratchpad which is controlled by the two buttons at the ends of
  570. the third row on the keypad. Place the caret in the field you want to copy
  571. and click on the left button. This stores the contents of the field on the
  572. scratchpad. Moving the caret to another field and clicking the right button
  573. copies the data from the scratchpad into that field, over-writing its
  574. previous contents. You may continue to “paste” the data into new fields as
  575. often as you like. Only when you click the left button again are the
  576. contents of the scratchpad changed. Data pasted into a field will not be
  577. allowed to overflow; if too long for the field it will be cut to the
  578. permitted length. As an added precaution you can’t paste into a field if
  579. there is nothing on the scratchpad so accidental blanking of fields is
  580. avoided. 
  581.  
  582. 3.3 Undoing mistakes
  583.  
  584. You might edit the wrong field by mistake and want to restore the previous
  585. contents. Click MENU over the field. The second entry on the main menu
  586. contains the tag of the field. Follow the right-pointing arrow to the Field
  587. sub-menu and choose Undo changes. The previous contents of the field will be
  588. restored. Similarly, if you make a mess of a whole record and want to go
  589. back to the way it was you can choose Undo changes from the main menu. 
  590.  
  591. It is important to realise that the Undo facilities will not work if you
  592. have looked at another record before using them (or clicked on Force
  593. update). You can only recover data which has been altered in or removed from
  594. the currently-displayed record. 
  595.  
  596. 3.4 Adding new records
  597.  
  598. First we will add a new record for a fictitious element as described below:−
  599.  
  600.         NAME            TASMANIUM                    
  601.  
  602.         SYMBOL                  Ts                    
  603.  
  604.         ATOMIC NUMBER   108 
  605.  
  606. The second button on the second row of the keypad has a plus sign and a
  607. “record card” icon. This is the Insert button. A blank record will be
  608. displayed with the caret in the NAME field.  Enter TASMANIUM here and type
  609. Return. The caret will jump to the SYMBOL field. Enter Ts. You will now need
  610. to press Return twice to get to ATOMIC NUMBER (One press takes you to the
  611. un-named field after NAME where the origin of the element’s name is given.)
  612. Alternatively you could point the mouse at the ATOMIC NUMBER field and click
  613. SELECT. There is no need to press Return after entering a field in order to
  614. accept the data; it’s just the most convenient way of getting to the next
  615. field.  When entering data into widely-scattered fields it is more
  616. convenient to use the mouse to move the caret. 
  617.  
  618. Having entered the data click any of the first row of buttons so a different
  619. record is shown. Now use Search to find TASMANIUM by name (its key will be
  620. TASM). Change to the other index and find it by atomic number. In both cases
  621. try moving to the record just before and just after the new one, noting that
  622. it has been placed in its correct position in both indices: between TANTALUM
  623. and TECHNETIUM in the NAME index and at the end of the ATOMIC NUMBER index. 
  624.  
  625. 3.5 Data Input Validation
  626.  
  627. When entering the above data you may have noticed that the NAME field will
  628. only accept capital letters and the ATOMIC NUMBER field will only accept
  629. numerals. Any others are simply ignored. We call this feature character
  630. validation. 
  631.  
  632. Another level of data validation, which we will now illustrate, is called
  633. table validation  Make an entry in the GROUP field. Type X, for example,
  634. then try to move to another field by either typing Return or clicking the
  635. mouse. You will find that you can’t do so; you get an error message instead.
  636. This is because the GROUP field is linked to a validation table which means
  637. that only entries which appear in the table may be used in that field.
  638. Fields linked to validation tables are distinguished by using dark green,
  639. instead of black, as the foreground colour. 
  640.  
  641. To see what the validation table contains, place the caret in the GROUP
  642. field then click on the List values button on the keypad. The validation
  643. table will be displayed in its own window. Only items in the left column of
  644. the table may be entered in the GROUP field. Element 108 would be a
  645. transition metal, so enter T. You will now find that Powerbase accepts your
  646. data. 
  647.  
  648. Both character validation and table validation may be turned off and on by
  649. means of a switch on the Preferences window. To get at this window click
  650. MENU over the Powerbase icon on the icon-bar and choose  Preferences  from
  651. the icon-bar menu. The rather large window which appears has a collection of
  652. option switches down its left-hand side. The sixth of these (Validate input)
  653. is normally ON to indicate that validation is in effect. Click to turn it
  654. off then click on Accept. The Preferences window will be removed from the
  655. screen and you will find that input is no longer being validated.
  656.  
  657. 3.6 Deleting records
  658.  
  659. Since “tasmanium” isn’t a real element we want to remove it from our
  660. database. There is a “dustbin” button  which will do exactly that but we
  661. won’t use it just yet.  Make sure that the unwanted record is on the screen
  662. and click the button to the right of the bin. You will now find that
  663. TASMANIUM has vanished; the names run from TANTALUM to TECHNETIUM and the
  664. atomic numbers end with 103, just as they did before you added the extra
  665. record. 
  666.  
  667. What if you had clicked the button by mistake and deleted an important
  668. record? Powerbase handles this very nicely. The record hasn’t really been
  669. deleted at all. To prove this, click on the button above the one you used
  670. for “deleting”. This shows a green right-pointing arrow and a “card index”
  671. icon. TASMANIUM will reappear. You will also find that it appears to be the
  672. only record in the file! Don’t worry; nothing has been lost. A Powerbase
  673. database is treated as six separate subfiles numbered 0-5. When you first
  674. open the database you are looking at Subfile 0 and the heading of the record
  675. window shows this. If you look at the heading now you will see that it has
  676. changed to Subfile 1.  The button you hav just clicked advances the subfile
  677. number by 1.  Its counterpart on the left has the opposite effect.
  678.  
  679. The buttons on either side of the bin carry pictures which suggest their
  680. true functions. They do not delete records; they merely move records from
  681. one subfile to another. The right button moves the displayed record to the
  682. next subfile in sequence. Thus, in the above case TASMANIUM has been moved
  683. from subfile 0 to subfile 1. A record in subfile 1 would be moved to subfile
  684. 2 and so on. When it gets to 5 the next click moves it into subfile 0 where
  685. it was originally. As you may have guessed, the left button moves records in
  686. the opposite direction, i.e. from subfile 1 to 0 or from subfile 0 to 5. 
  687.  
  688. If you do want to lose a record for good you consign it to the dustbin.  As
  689. this button’s action is more drastic than that of the other two you are
  690. asked to confirm that this really is what you want to do before the deletion
  691. goes ahead.
  692.  
  693. 4  Printing Lists
  694.  
  695. Before Powerbase can produce a list it must be told:− 
  696.  
  697. •       which fields should appear on the list
  698.  
  699. •       which records should appear on the list. 
  700.  
  701. 4.1 Making the field selection
  702.  
  703. Specifying the fields you want is extremely easy. To include a field point
  704. the mouse at it and click with ADJUST. The selected field will appear with
  705. its foreground and background colours reversed. If you change your mind
  706. about a field you can de-select it by clicking on it again with ADJUST. The
  707. order in which the fields will appear in the printed list is the order in
  708. which you select them. Take care since there is nothing on the screen to
  709. indicate what order the fields will be in.  The fields chosen for inclusion
  710. in a printout make up a selection which may be saved, using Save selection
  711. from the Print submenu, and reloaded for future use. Just for now select
  712. NAME, SYMBOL and GROUP. 
  713.  
  714. 4.3 Choosing which records to print
  715.  
  716. Specifying which records to print is more complicated, although efforts have
  717. been made to render it as simple as possible. With the pointer in the record
  718. window click MENU. This displays the main Powerbase menu from which you
  719. should choose Print. A small window appears in which you specify the
  720. criteria which must be met by records for inclusion in the list. If you just
  721. click the Print button (or type Return) without entering anything here you
  722. will obtain a list of the whole database (or, more accurately, the the whole
  723. of the current subfile). Try this first.
  724.  
  725. Nothing will be printed until the search is complete. If the mouse pointer
  726. is over the main window the hourglass will tell you how far things have
  727. progressed. Pressing Escape will cause the process to be aborted. When
  728. complete the list will be displayed in a window. Clicking MENU over it
  729. displays a menu which leads to a Save box. You may  save the list as a text
  730. file by dragging the file icon to a filer window or print it by loading
  731. !Printers and dropping the file icon on the !Printers icon on the icon-bar.
  732.  
  733. If you point to a record in the displayed list and double-click with SELECT
  734. Powerbase will display the chosen record in the main record window. Moreover
  735. the caret is placed in the field you were pointing to on the list. This is
  736. very useful if you spot errors in the data whilst examining a list. A double
  737. click on the offending item offers the record with the caret correctly
  738. positioned for editing. 
  739.  
  740. Most database queries don’t, of course, involve printing all the records.
  741. You will usually need to enter a search formula before clicking Print. You
  742. have already used a search formula when you typed GP=1 to “filter out” all
  743. but the six Alkali Metal records (see 2.3). Search formulae can be complex
  744. and a more detailed treatment is given in the Manual. Only a few simple
  745. examples are shown here. 
  746.  
  747. Suppose we want a list of all transitional elements. i.e. all those which
  748. have T in the GROUP field. We can do this by entering the search formula:−
  749.  
  750. GP=T 
  751.  
  752. Why GP?  GROUP=T seems the more obvious choice but Elements contains many
  753. fields which have no label, such as the one on the first line which gives
  754. the origin of the element’s name. Every field which can hold data has to
  755. have a handle by which we can refer to it and that handle is called the
  756. field tag. Tags are very short; never more than four characters. You have
  757. seen some tags already. Look at the list you printed earlier. The three
  758. columns are headed with the tags (NAME, SYM and GP) not the descriptors
  759. (NAME, SYMBOL and GROUP). We therefore meets tags in two contexts:− 
  760.  
  761. •       specifying fields in search formulae 
  762.  
  763. •       as the default column headings in lists 
  764.  
  765. The Print options window, displayed by choosing Options from the Print
  766. submenu, lets you change the column headings to field descriptors if you
  767. prefer them.
  768.  
  769.  
  770.  
  771. Type GP=T in the space provided and click Print. This time the list will be
  772. a much shorter one and you will see that the GP column contains T in every
  773. case. 
  774.  
  775. The second example involves printing all elements whose names end in “IUM”.
  776. What we need to specify is that NAME contains IUM and we do this by entering
  777. the search formula:−
  778.  
  779. NAME{IUM.  
  780.  
  781. Note the use of a left brace (curly bracket) to mean “contains”.  Another
  782. way to perform this search is to use a wild-card. Type:−
  783.  
  784. NAME=$IUM 
  785.  
  786. Clicking Print will produce the same list as before. The “$” is a wild-card
  787. character which can represent any number of unspecified characters. The
  788. search formula is saying in effect, “I don’t care what the first part of the
  789. name is as long as it ends with IUM”.
  790.  
  791. We will combine the previous two examples into a two-pronged search for all
  792. the TRANSITIONAL elements whose names end in “IUM”. The search formula this
  793. time is either:−
  794.  
  795. NAME{IUM AND GP=T 
  796.  
  797.                 or:− 
  798.  
  799. NAME=$IUM AND GP=T 
  800.  
  801. Note the spaces before and after AND. These are essential. You might like to
  802. try an alternative way of entering a search formula. Proceed as follows:− 
  803.  
  804. 1.      Click the Help button on Print window. This opens the Help window.  
  805.  
  806. 2.      NAME should already be visible as the required field, but you need
  807. to select the radio button for contains.  
  808.  
  809. 3.      Click in the space next to Value and enter IUM.         
  810.  
  811. 4.      Click Add to formula.  The search formula now reads NAME{IUM.        
  812.  
  813. 5.      Click the AND button.
  814.  
  815. 6.      Click on the “menu” button to the right of the tag display and
  816. choose item 6 (GP) 
  817.  
  818. 7.      Select the radio button for is equal to
  819.  
  820. 8.      Enter T in the Value field.
  821.  
  822. 9.      Click Add to formula
  823.  
  824. The complete search formula should now be visible so click Print and the
  825. list will be produced. The procedure takes far longer to describe than to do
  826. and can be a great help to the infrequent Powerbase user who has trouble
  827. remembering the syntax of search formulae. If you use complex queries often
  828. you may find it convenient to save them for future use. Save query from the
  829. Print submenu enables you to do this.
  830.  
  831. The biggest problem you are likely to encounter is not knowing the tags for
  832. the various fields. By using the above method you can see all the tags
  833. displayed in a menu or cycle through them using a pair of arrowheads called
  834. “bump” icons. It is also useful to know that clicking with SELECT on a field
  835. while holding down Ctrl causes the tag of that field to appear in the search
  836. formula icon. 
  837.  
  838. 5  Merging data into an Impression document
  839.  
  840. The distribution disc contains a simple Impression document called
  841. MergeTest. It will be used in conjunction with the Elements database to
  842. illustrate direct data-merging with Impression. 
  843.  
  844. (1)     Ensure that Impression has been “seen” by the filer. (You need not
  845. actually load it.) 
  846.  
  847. (2)     Open the Elements database and drop MergeTest onto the record
  848. window. The Data merge window will appear.
  849.  
  850. (3)     Click on Merge. You will see that data relating to the record for
  851. ACTINIUM has been inserted into the Impression document. 
  852.  
  853. (4)     The arrow and double-arrow buttons, identical to those on the
  854. keypad, may be used to move through the database merging different records
  855. into the document. 
  856.  
  857. (5)     A search formula may be used to restrict the operation to records
  858. matching certain criteria. 
  859.  
  860. (6)     Print may be used to print the document with the currently-merged
  861. data. To print a set of documents, one for each matching element, select
  862. Print all then click on Merge. 
  863.  
  864.  
  865.  
  866. During data-merging Impression editing is disabled; you can’t place the
  867. caret in the document and the mouse pointer appears as a red and blue cross.
  868. Clicking on Cancel or closing the Data merge window restores normal editing. 
  869.  
  870. For more information on data-merging, including instructions on how to
  871. prepare the Impression document, see Ch 9 in the Manual.
  872.  
  873. 6  Closing down
  874.  
  875. A database may be closed down by choosing the Close database entry from the
  876. icon bar menu. When you do so, all the indices stored in memory are saved to
  877. disc and the database is closed. You do not have to do anything to save the
  878. database itself to disc since it has been there all along. Only the current
  879. record is in memory at any one time and this is automatically written back
  880. to disc when it has been changed in any way. 
  881.  
  882. Also saved automatically is the link file which holds the relational links
  883. between the main database and the validation tables. The tables themselves
  884. are also saved.
  885.  
  886. There’s also an Abandon database entry on the icon-bar menu. This too will
  887. close your database but without saving new data to the disc. It is really
  888. intended as the quickest way to close a database which you have opened
  889. simply for examination. If you are entering data for real you should use
  890. Close database.
  891.  
  892. If you are going to use another database straight away just double click on
  893. it or drag it to the Powerbase icon on the icon bar. In fact you don’t even
  894. need to close the previous database before doing this; Powerbase will do it
  895. for you. 
  896.  
  897. When working with a database on the RAM disc Powerbase will issue a warning
  898. that the data is not secure and that you need to drag it from the RAM disc
  899. to a floppy or hard disc before switching off. 
  900.  
  901. To terminate Powerbase itself use the Quit option on the icon bar menu.